package com.cryptoneedle.center.config.controller;

import com.bubbles.engine.common.core.result.Result;
import com.cryptoneedle.center.config.entity.ConfigSystem;
import com.cryptoneedle.center.config.service.ConfigSystemService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>description: 配置系统 控制器 </p>
 *
 * @author CryptoNeedle
 * @date 2025-09-26
 */
@Tag(name = "配置系统", description = "配置系统")
@RestController
@RequestMapping("/config/system")
public class ConfigSystemController {

    @Resource
    private ConfigSystemService configSystemService;

    @PostMapping("/list")
    public Result<List<ConfigSystem>> list() {
        return Result.success(configSystemService.list());
    }

    @PostMapping("/save")
    public Result<?> save(@RequestBody ConfigSystem configSystem) {
        configSystemService.save(configSystem);
        return Result.success();
    }
}